package syan.kafkastream.Config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.stereotype.Component;
import syan.kafkastream.Service.EsChannel;

/**
 * @author CHENTAIWEN
 * @create 2022/8/24 15:07
 */
@Component
public class SendService {
    @Autowired
    private EsChannel source;

    public void sendMsg(String msg) {
        source.messageDemo1Output().send(MessageBuilder.withPayload(msg).build());

        source.messageDemo2Output().send(MessageBuilder.withPayload(msg).build());
    }
}
